package edu.hm.compiler.parser.grammar;

import edu.hm.compiler.I18NCompiler;

public class Rule
{
    private final Head       head;
    private final BodyOption bodyOption;

    public Rule( Head head, BodyOption bodyOption )
    {
        if( head == null || bodyOption == null )
            throw new IllegalArgumentException( I18NCompiler.getString("ArgumentsNotNull") ); //$NON-NLS-1$
        this.head = head;
        this.bodyOption = bodyOption;
    }

    public Head getHead()
    {
        return this.head;
    }

    public BodyOption getBodyOption()
    {
        return this.bodyOption;
    }

    @Override
    public String toString()
    {
        return "Rule [head=" + head + ", bodyOption=" + bodyOption + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }
}
